/**
 * 通用的JS放在这里
 */
$(function () {
    //退出登录弹出框
    var logout = $("#logout");
    logout.click(function () {
        $("#logout-pop").show();
    });

    //通用关闭按钮 class close-btn
    var closeBtn = $(".close-btn");
    closeBtn.click(function () {
        $(".modal").hide();
    });

    //退出登录操作
    var closeConfirm = $('#logout-confirm');
    closeConfirm.click(function () {
        $.ajax({
            url:'/api/logout',
            type:"POST",
            success:function (data) {
                console.log("退出登录成功：",data);
                if(data.status == "000000"){
                    window.location.href="/login";
                }
            },
            error:function (error) {
                console.log(error);
            }
        });
    });

});
